Skip to content

Add ecdsa cert support for client through SSH agent#1440

Open
xRemaLx wants to merge 3 commits into
mscdex:masterfrom
xRemaLx:ssh-agent-cert-support
Open

Add ecdsa cert support for client through SSH agent#1440
xRemaLx wants to merge 3 commits into
mscdex:masterfrom
xRemaLx:ssh-agent-cert-support

Conversation

@xRemaLx

@xRemaLx xRemaLx commented Jan 25, 2025

Copy link
Copy Markdown

Add ecdsa-sha2-nistp(256|384|521)-cert-v01@openssh.com for client through SSH_AGENT

It is work in case from #910 and #858

I test on my server like this:

const { Client } = require('ssh2');

const conn = new Client();
conn.on('ready', () => {
    console.log('Client :: ready');
    conn.exec('uptime', (err, stream) => {
        if (err) throw err;
        stream.on('close', (code, signal) => {
          console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
          conn.end();
        }).on('data', (data) => {
          console.log('STDOUT: ' + data);
        }).stderr.on('data', (data) => {
          console.log('STDERR: ' + data);
        });
    });
}).connect({
    host: 'test.server',
    port: 22,
    username: 'xremalx',
    agent: process.env.SSH_AUTH_SOCK,
});

@kobrineli

Copy link
Copy Markdown

@mscdex
Hi! Could you review this, please?

@xRemaLx

xRemaLx commented Feb 7, 2025

Copy link
Copy Markdown
Author

@mscdex
Hi! Are there any updates on this? Could you review this, please?

Comment thread lib/protocol/keyParser.js

function tryParseAsCert(data, baseType, comment) {
if (!isSupportedCertType(baseType))
return new Error(`Unsupported OpenSSH cert type: ${baseType}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal note (dunno if it really makes sense): This is the only caller of isSupportedCertType and the code below generates the very same error in its default: case. So, you could remove isSupportedCertType and the two lines above without any change in behaviour.

Still, it might make sense to keep things like this just for consistency with the rest of the library (there is also isSupportedKeyType()). I'll leave that to @mscdex to decide.

@xRemaLx

xRemaLx commented Mar 27, 2025

Copy link
Copy Markdown
Author

Hi @mscdex!

I'm wondering if there are any comments or updates on this matter?

@xRemaLx

xRemaLx commented Jun 11, 2025

Copy link
Copy Markdown
Author

Hello @mscdex!
Please pay attention to this request.
Thanks!

Comment thread lib/protocol/keyParser.js Outdated
xRemaLx and others added 2 commits June 20, 2025 15:48
@xRemaLx

xRemaLx commented Sep 24, 2025

Copy link
Copy Markdown
Author

Hello @mscdex!
I am still waiting for your attention to this request.
Thanks!

@xRemaLx

xRemaLx commented Dec 21, 2025

Copy link
Copy Markdown
Author

Hello @mscdex! Could you review this, please? Thanks!

@xRemaLx

xRemaLx commented Jan 26, 2026

Copy link
Copy Markdown
Author

@mscdex, a year has passed, is there a way to check the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants